Skip to content

Conversation

@h3adex
Copy link
Contributor

@h3adex h3adex commented Feb 6, 2026

Description

reopened #1023

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@h3adex h3adex requested a review from a team as a code owner February 6, 2026 10:13
isValid: true,
},
{
description: "routing-table id invalid",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the routing-table-id flag is optional, could we please have a test case without the flag being set or being invalid?

ipv6DnsNameServersFlag: "2001:4860:4860::8888,2001:4860:4860::8844",
ipv6GatewayFlag: "2001:4860:4860::8888",
labelFlag: "key=value",
routingTableIdFlag: testRoutingTableId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, routing table id flag is optional to there must be at least 1 test case IMO which doesn't have it set

}

func outputResult(p *print.Printer, outputFormat string, routingTable *iaas.RoutingTable) error {
if routingTable == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition can be moved into the callback func for the pretty output, so the JSON/YAML output is the actual API response

return fmt.Errorf("create routing-table response is empty")
}

if routingTable.Id == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

}

func outputResult(p *print.Printer, outputFormat, routingTableId, networkAreaId string, route *iaas.Route) error {
if route == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check can be removed, is already present in the pretty output callback func

return fmt.Errorf("update route response is empty")
}

if route.Id == nil || *route.Id == "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check can be removed, is already present in the pretty output callback func

return fmt.Errorf("update routing-table response is empty")
}

if routingTable.Id == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check belongs into pretty output callback func, JSON/YAML output won't have problems with this being nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants